﻿@using MvcAtletIS.Helpers;
@model IEnumerable<MvcAtletIS.Models.StatisticsCompetitions>

@{
    ViewBag.Title = "Preteky pre štatistiku";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>Preteky pre štatistiku</h2>

@using (Html.BeginForm())
{   
    <div class="editor-label">
        Rok
    </div>
    <div class="editor-field">
        @Html.DropDownList("SelectedYear", null, "Vyberte rok", new { onchange = "this.form.submit();" })
    </div>
}

<p>
    @Html.ActionLink("Pridať nové preteky", "Create")
</p>

<table>
    <tr>
        <th width="200px">
            Mesto
        </th>
        <th>
            Poznámka
        </th>
        <th>
            Názov
        </th>
        <th>
            Dátum
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.City)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Note)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Name)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Date)
        </td>
        <td>
            @Html.ImageActionLink(Url.Content("~/Content/icons/preview.gif"), "", "Details", new { id = item.ID }, new { title = "Zobraziť", border = 0, hspace = 2 }) |
            @Html.ImageActionLink(Url.Content("~/Content/icons/edit.gif"), "", "Edit", new { id = item.ID }, new { title = "Editovať", border = 0, hspace = 2 })
        </td>
    </tr>
}

</table>

<p>
    @Html.ActionLink("Pridať nové preteky", "Create")
</p>
